package com.md.youyouhui.net;

/**
 * Created by AdministratorZJ
 * on 2017/12/6.
 *
 * @author AdministratorZJ
 */

public class Result<T> {
    public static final int SUCCESS = 1;

    public int code;
    public String msg;
    public T data;

    @Override
    public String toString() {
        return "Result{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                ", data=" + data +
                '}';
    }

    public static boolean isSuccess(Result result) {
        return result != null && result.code == SUCCESS;
    }

    public final boolean isSuccessful() {
        return code == SUCCESS;
    }

}
